#include <iostream>
#include <fstream>
#include <unistd.h>
#include <string>
#include <unordered_map>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>

const char* file = "file_dict";

class Dict
{
public:
    Dict()
    {
        std::ifstream in(file);
        std::string line ; 
        while(getline(in ,line))
        {
            std::string part1,part2;
            int pos = line.find(":");
            part1 = line.substr(0 , pos);
            part2 = line.substr(pos + 1);

            dict_[part1] = part2;
        }
    }

    std::string translate(const std::string& word)
    {
        if(!dict_.count(word)) return "no word";
        else return dict_[word];
    }

private:
    std::unordered_map<std::string , std::string> dict_;
};

